<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <h1>模板语法的学习</h1>
    <div>{{ n1 }}</div>
    <div>{{ n2 }}</div>
    {# 获取列表的每一个元素 #}
    <div>{{ n2.0 }}</div>
    <div>{{ n2.1 }}</div>
    <div>{{ n2.2 }}</div>
    {#  通过循环  #}
     <div>
         {% for item in n2 %}
             <span>{{ item }}</span>
         {% endfor %}
     </div>
    <hr>
    {#  字典  #}
    {{ n3 }}
    {#  通过键来获得值  #}
    {{ n3.name }}
    {{ n3.salary }}
    {{ n3.roles }}
    {# 循环 #}
    <div>
        {% for item in n3.values %}
            <span>{{ item }}</span>
        {% endfor %}
    </div>
    <hr>
    {{ n4.0 }}
    {{ n4.0.name }}
    {{ n4.0.roles }}

    {% for item in n4 %}
        <div>{{ item.name }} {{ item.salary }} {{ item.roles }}</div>
    {% endfor %}

    <hr>
    {% if n1 == "韩信" %}
        <h1>哒哒哒哒</h1>
    {% elif n1 == "xxxx" %}
        <h1>xxxxx</h1>
    {% else %}
        <h1>嘟嘟嘟嘟</h1>
    {% endif %}
</body>
</html>